import requests


class RequestsClient:
    session = requests.Session()

    def send(self, method, url, **kwargs):
        """
        通用请求方法
        :param method: 请求方法 (GET, POST, PUT, DELETE 等)
        :param url: 请求地址
        :param kwargs: 其他参数（headers, params, json, data, files 等）
        """
        try:
            resp = self.session.request(method=method, url=url, verify=False, **kwargs)
            resp.raise_for_status()  # 检查响应状态码是否为 200~299
            return resp
        except requests.exceptions.RequestException as e:
            print(f"请求失败：{e}")
            return None
